package com.puff.jdbc.core;

import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;

/**
 * Context
 * @author dongchao
 *
 */
public class Context {

	public Object param;

	public StringWriter sw = new StringWriter();

	/**
	 * List形式
	 */
	public List<Object> args = new ArrayList<Object>();

	/**
	 * 获取数组
	 * @return
	 * 	预编译参数
	 */
	public Object[] getArgsArray() {
		return args.toArray();
	}

	/**
	 * 获取List
	 * @return
	 * 	预编译参数
	 */
	public List<Object> getArgs() {
		return args;
	}

	@Override
	public String toString() {
		String string = sw.toString();
		return string != null ? string.trim() : "";
	}

}
